#include "Q4_2.h"

void q4_2_run_with_memcpy()
{
	int* c = new int[20];

	memcpy(c, a, 10*sizeof(int));
	memcpy(c+10, b, 10*sizeof(int));

	printf("Q4.2 use memcpy\n");
	for(register int i=0; i<20; i++)
		printf("C[%d]: %d\n", i, c[i]);

	delete[] c;
}

void q4_2_run_without_memcpy()
{
	int* c = new int[20];

	register int i;
	for(i=0; i<10; i++)
	{
		c[i] = a[i];
		c[i+10] = b[i];
	}

	printf("Q4.2 without memcpy\n");
	for(register int i=0; i<20; i++)
		printf("C[%d]: %d\n", i, c[i]);

	delete[] c;
}